/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Principal.java
 *
 * Created on 17/10/2012, 08:33:40
 */

package view;

import com.nilo.plaf.nimrod.NimRODLookAndFeel;
import com.nilo.plaf.nimrod.NimRODTheme;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import sun.applet.Main;

/**
 *
 * @author Ewerton
 */
public class Principal extends javax.swing.JFrame {

    /** Creates new form Principal */
    public Principal() {
        //int largura = Toolkit.getDefaultToolkit().getScreenSize().width;
        //int altura = Toolkit.getDefaultToolkit().getScreenSize().height;
        //UIManager.setLookAndFeel("com.nilo.plaf.nimrod.NimRODLookAndFeel");
        NimRODTheme nimRODTheme = new NimRODTheme(Main.class.getResource("/themes/NimRODBlue.theme"));
        NimRODLookAndFeel nimRODLookAndFeel = new NimRODLookAndFeel();
        nimRODLookAndFeel.setCurrentTheme(nimRODTheme);
        try {
            UIManager.setLookAndFeel(nimRODLookAndFeel);
        } catch (UnsupportedLookAndFeelException ex) {
            Logger.getLogger(Principal.class.getName()).log(Level.SEVERE, null, ex);
        }
        ImageIcon icone = new ImageIcon("src/icons/produto.PNG");   
        setIconImage(icone.getImage());
        initComponents();
        //setSize(largura, altura);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        btUnidadeGestora = new javax.swing.JButton();
        btLotacao = new javax.swing.JButton();
        btFornecedor = new javax.swing.JButton();
        jBCompras = new javax.swing.JButton();
        jBTranferir = new javax.swing.JButton();
        tfProduto = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        btUnidade = new javax.swing.JButton();
        btLotacaoConsulta = new javax.swing.JButton();
        btFornecedorBusca = new javax.swing.JButton();
        btProdutoConsulta = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Controle de Estoque");
        setResizable(false);

        jPanel1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

        btUnidadeGestora.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/unidadeGestora.png"))); // NOI18N
        btUnidadeGestora.setText("Unidade Gestora");
        btUnidadeGestora.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btUnidadeGestora.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
        btUnidadeGestora.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btUnidadeGestora.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btUnidadeGestoraActionPerformed(evt);
            }
        });

        btLotacao.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/lotacao48.png"))); // NOI18N
        btLotacao.setText("Lotação");
        btLotacao.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btLotacao.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
        btLotacao.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btLotacao.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btLotacaoActionPerformed(evt);
            }
        });

        btFornecedor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/fornecedor48.png"))); // NOI18N
        btFornecedor.setText("Fornecedor");
        btFornecedor.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btFornecedor.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
        btFornecedor.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btFornecedor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btFornecedorActionPerformed(evt);
            }
        });

        jBCompras.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/entrada48.png"))); // NOI18N
        jBCompras.setText("Entrada");
        jBCompras.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBCompras.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
        jBCompras.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jBCompras.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBComprasActionPerformed(evt);
            }
        });

        jBTranferir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/transf.png"))); // NOI18N
        jBTranferir.setText("Transferir");
        jBTranferir.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jBTranferir.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
        jBTranferir.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jBTranferir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBTranferirActionPerformed(evt);
            }
        });

        tfProduto.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/produto.png"))); // NOI18N
        tfProduto.setText("Produto");
        tfProduto.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        tfProduto.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
        tfProduto.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        tfProduto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tfProdutoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(btUnidadeGestora)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btLotacao)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btFornecedor)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jBCompras, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jBTranferir)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tfProduto)
                .addContainerGap(800, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(btUnidadeGestora)
            .addComponent(btLotacao)
            .addComponent(btFornecedor)
            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                .addComponent(jBTranferir, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jBCompras, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addComponent(tfProduto)
        );

        jTabbedPane1.addTab("Cadastros", jPanel1);

        btUnidade.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/unidade24.png"))); // NOI18N
        btUnidade.setText("Unidade Gestora");
        btUnidade.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        btUnidade.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btUnidadeActionPerformed(evt);
            }
        });

        btLotacaoConsulta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/lotacao24.png"))); // NOI18N
        btLotacaoConsulta.setText("Lotação");
        btLotacaoConsulta.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        btLotacaoConsulta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btLotacaoConsultaActionPerformed(evt);
            }
        });

        btFornecedorBusca.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/fornecedor24.png"))); // NOI18N
        btFornecedorBusca.setText("Fornecedor");
        btFornecedorBusca.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        btFornecedorBusca.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btFornecedorBuscaActionPerformed(evt);
            }
        });

        btProdutoConsulta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/produto24.png"))); // NOI18N
        btProdutoConsulta.setText("Produto");
        btProdutoConsulta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btProdutoConsultaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(btLotacaoConsulta, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btUnidade, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(btProdutoConsulta, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btFornecedorBusca, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(1128, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btUnidade)
                    .addComponent(btFornecedorBusca))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btLotacaoConsulta)
                    .addComponent(btProdutoConsulta))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Consultas e Relatórios", jPanel4);

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/themes/ID_Solutions.png"))); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1363, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addComponent(jLabel1)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        java.awt.Dimension dialogSize = getSize();
        setLocation((screenSize.width-dialogSize.width)/2,(screenSize.height-dialogSize.height)/2);
    }// </editor-fold>//GEN-END:initComponents

    private void btUnidadeGestoraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btUnidadeGestoraActionPerformed
        UnidadeGestoraVIEW ug = new UnidadeGestoraVIEW(this, true);
        ug.setVisible(true);
}//GEN-LAST:event_btUnidadeGestoraActionPerformed

    private void btLotacaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btLotacaoActionPerformed
        LotacaoVIEW lotacao = new LotacaoVIEW(this, true);
        lotacao.setVisible(true);
}//GEN-LAST:event_btLotacaoActionPerformed

    private void btFornecedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btFornecedorActionPerformed
        FornecedorVIEW fornecedor = new FornecedorVIEW(this, true);
        fornecedor.setVisible(true);
}//GEN-LAST:event_btFornecedorActionPerformed

    private void jBComprasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBComprasActionPerformed
        // TODO add your handling code here:
        CompraVIEW compra = new CompraVIEW(this, true);
        compra.setVisible(true);
    }//GEN-LAST:event_jBComprasActionPerformed

    private void jBTranferirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBTranferirActionPerformed
        TransferenciaVIEW transf = new TransferenciaVIEW(this, true);
        transf.setVisible(true);
}//GEN-LAST:event_jBTranferirActionPerformed

    private void tfProdutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tfProdutoActionPerformed
        ProdutoVIEW produto = new ProdutoVIEW(this, true);
        produto.setVisible(true);
    }//GEN-LAST:event_tfProdutoActionPerformed

    private void btUnidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btUnidadeActionPerformed
        UnidadeGestoraConsulta ugc = new UnidadeGestoraConsulta(this, true);
        ugc.setVisible(true);
    }//GEN-LAST:event_btUnidadeActionPerformed

    private void btLotacaoConsultaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btLotacaoConsultaActionPerformed
        LotacaoConsulta lc = new LotacaoConsulta(this, true);
        lc.setVisible(true);
    }//GEN-LAST:event_btLotacaoConsultaActionPerformed

    private void btFornecedorBuscaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btFornecedorBuscaActionPerformed
        FornecedorConsulta fc = new FornecedorConsulta(this, true);
        fc.setVisible(true);
    }//GEN-LAST:event_btFornecedorBuscaActionPerformed

    private void btProdutoConsultaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btProdutoConsultaActionPerformed
        ProdutoConsulta pc = new ProdutoConsulta(this, true);
        pc.setVisible(true);
    }//GEN-LAST:event_btProdutoConsultaActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Principal().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btFornecedor;
    private javax.swing.JButton btFornecedorBusca;
    private javax.swing.JButton btLotacao;
    private javax.swing.JButton btLotacaoConsulta;
    private javax.swing.JButton btProdutoConsulta;
    private javax.swing.JButton btUnidade;
    private javax.swing.JButton btUnidadeGestora;
    private javax.swing.JButton jBCompras;
    private javax.swing.JButton jBTranferir;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JButton tfProduto;
    // End of variables declaration//GEN-END:variables

}
